package cn.koala.key.firstmaintain.converter;

import cn.koala.key.common.converter.Converter;
import cn.koala.key.firstmaintain.entity.dto.FirstMaintainCardBorrowOrderCancelDTO;
import cn.koala.key.firstmaintain.entity.vo.FirstMaintainCardBorrowOrderCancelVO;

/**
 * 取消首保卡视图转数据传输
 *
 * @author liutao
 * @date 2021/2/4
 */
public class FirstMaintainCardBorrowOrderCancelVO2DTO implements Converter<FirstMaintainCardBorrowOrderCancelVO, FirstMaintainCardBorrowOrderCancelDTO> {
    private final String oprNo;
    private final String oprName;

    public FirstMaintainCardBorrowOrderCancelVO2DTO(String oprNo, String oprName) {
        this.oprNo = oprNo;
        this.oprName = oprName;
    }

    @Override
    public FirstMaintainCardBorrowOrderCancelDTO convert(FirstMaintainCardBorrowOrderCancelVO source) {
        if (source == null) {
            return null;
        }
        FirstMaintainCardBorrowOrderCancelDTO target = new FirstMaintainCardBorrowOrderCancelDTO();
        target.setOrderNo(source.getOrderNo());
        target.setCancelNote(source.getCancelNote());
        target.setOprNo(oprNo);
        target.setOprName(oprName);
        return target;
    }
}
